<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			/*
			   继承：
			   1.属性 call
			   2.行为 prototype							
			*/
		   
			//this指向window对象
			function Person(name, age) {
				this.name = name;
				this.age = age;
			}

			function Student(name, age, score) {
				// this.name = name;
				// this.age = age;
				this.score = score;
				//function.call(thisArg, arg1, arg2, ...)
				/*
				 call作用:
				 1.调用函数
				 2.改变this指向
				 
				 参数:
				 1.参数1:函数运行时this的值
				 2.参数2,参数3...
				*/
				Person.call(this, name, age);
			}

			var stu01 = new Student('张三', 20, 98);
			// console.log(stu01.name);



			function Worker(name, age, hours) {
				this.name = name;
				this.age = age;
				this.hours = hours;
			}
		</script>
	</body>
</html>
